﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SF.Common;
using System.Text;

namespace SF.Ucenter.admin.business
{
    public partial class app_list : Web.UI.ManagePage
    {
        protected string action = string.Empty;
        protected void Page_Load(object sender, EventArgs e)
        {
            this.action = DTRequest.GetQueryString("action");
            if (this.action == "setting")
            {
                int id = DTRequest.GetQueryInt("id");

                BLL.sf_appidmanage bll = new BLL.sf_appidmanage();
                Model.sf_appidmanage model = bll.GetModel(id);

                Session[DTKeys.SESSION_APP_INFO] = model.appid;
                Session[DTKeys.SESSION_TEMPLATES_INFO] = model.templatesNum;
                Response.Write("<script>parent.location.href='../index.aspx';</script>");
            }

            RptBind(" id>0", "id desc");
        }

        #region 数据绑定=================================
        private void RptBind(string _strWhere, string _orderby)
        {
            BLL.sf_appidmanage bll = new BLL.sf_appidmanage();
            System.Data.DataSet dsData = bll.GetList(" businessNum =  '" + Session[DTKeys.SESSION_BUSNIESE_NUM] + "'");
            dsData.Tables[0].Columns.Add("index");
            dsData.Tables[0].Columns.Add("index1");
            for (int i = 0; i < dsData.Tables[0].Rows.Count; i++)
            {
                dsData.Tables[0].Rows[i]["index"] = i;
                dsData.Tables[0].Rows[i]["index1"] = (i + 1);
            }

            this.rptList.DataSource = dsData;
            this.rptList.DataBind();


            if (dsData.Tables[0].Rows.Count >= 5)
            {
                divAdd.Visible = false;
            }
        }
        #endregion
         
    }
}